package com.example.backend.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultMessage<T> {
    private Integer code;
    private String message;
    private T data;

    public static <T> ResultMessage<T> success(T data) {
        return new ResultMessage<>(200, "success",data);
    }
    public static <T> ResultMessage<T> error(Integer code,String message) {
        return new ResultMessage<>(code, message, null);
    }
}
